home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 4.3 KB | 168 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWPat.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWPAT_H
- #define FWPAT_H
-
- #ifndef FWGROBJ_H
- #include "FWGrObj.h"
- #endif
-
- #if defined(FW_BUILD_WIN) && !defined(FWWINDIB_H)
- #include "FWWinDIB.h"
- #endif
-
- // ----- Foundation Includes -----
-
- #ifndef FWAUTODE_H
- #include "FWAutoDe.h"
- #endif
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CPatternRep;
- class FW_CLASS_ATTR FW_CColor;
-
- //========================================================================================
- // typedefs
- //========================================================================================
-
- union FW_BitPattern
- {
- unsigned char fData[8];
- unsigned long fDataLongs[2];
- };
-
- union FW_PixelPattern
- {
- unsigned char fData[8][8];
- unsigned char fDataRaw[8 * 8];
- unsigned long fDataLongs[8][2];
- };
-
- #ifdef FW_BUILD_MAC
- typedef PixPatHandle FW_PlatformColorPattern;
- #endif
- #ifdef FW_BUILD_WIN
- typedef FW_CPrivWinDIB::HDIB FW_PlatformColorPattern;
- #endif
-
- //========================================================================================
- // CLASS FW_PStyle
- //========================================================================================
-
- class FW_CLASS_ATTR FW_PPattern : public FW_CGraphicCountedPtr
- {
- public:
- FW_DECLARE_CLASS
-
- public:
- FW_PPattern();
- virtual ~ FW_PPattern();
-
- FW_PPattern(const FW_BitPattern& bits);
- FW_PPattern(const FW_PixelPattern& pixels, short nbColors, const FW_CColor* colorTable);
- FW_PPattern(FW_PlatformColorPattern platformColorPattern);
-
- FW_PPattern(const FW_PPattern& other);
- FW_PPattern& operator=(const FW_PPattern& other);
- FW_PPattern& operator=(const FW_BitPattern& bits);
-
- FW_CPatternRep* operator->();
- const FW_CPatternRep* operator->() const;
- };
-
- //----------------------------------------------------------------------------------------
- // FW_PPattern::operator->
- //----------------------------------------------------------------------------------------
- inline FW_CPatternRep* FW_PPattern::operator->()
- {
- return (FW_CPatternRep*)GetRep();
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PPattern::operator->
- //----------------------------------------------------------------------------------------
- inline const FW_CPatternRep* FW_PPattern::operator->() const
- {
- return (const FW_CPatternRep*)GetRep();
- }
-
- //========================================================================================
- // CLASS FW_CPatternRep
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CPatternRep : public FW_CGraphicCountedPtrRep
- {
- friend class FW_CLASS_ATTR FW_PPattern;
-
- public:
- FW_DECLARE_CLASS
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- protected:
- FW_CPatternRep();
- virtual ~FW_CPatternRep();
-
- //----------------------------------------------------------------------------------------
- // Memory management
- //
- public:
- void* operator new(size_t size);
- void operator delete(void* p);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- virtual FW_PPattern Copy() const = 0;
-
- virtual FW_Boolean IsBlack() const = 0;
-
- virtual void Invert() = 0;
-
- virtual void FlipHorizontaly() = 0;
- virtual void FlipVerticaly() = 0;
-
- virtual void ShiftUp() = 0;
- virtual void ShiftDown() = 0;
- virtual void ShiftLeft() = 0;
- virtual void ShiftRight() = 0;
-
- //----------------------------------------------------------------------------------------
- // Platform Specific
- //
- public:
- #ifdef FW_BUILD_MAC
- virtual void MacSetInCurPort() const = 0;
- #endif
-
- #ifdef FW_BUILD_WIN
- virtual HBRUSH WinCreatePatternBrush() const = 0;
- #endif
- };
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif
-